package org.batatasframework.util;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import cn.bonoon.kernel.util.StringHelper;

public class RequestUtils {
	public static Date getDate(HttpServletRequest request, String name){
		return StringHelper.toDate(request.getParameter(name));
	}
	
	public static int getInt(HttpServletRequest request, String name){
		return StringHelper.toInteger(request.getParameter(name));
	}
	
	public static long getLong(HttpServletRequest request, String name){
		return StringHelper.tolong(request.getParameter(name));
	}
	
	public static double getDouble(HttpServletRequest request, String name){
		return StringHelper.todouble(request.getParameter(name));
	}
}
